import java.util.Scanner;

public class Main2 {
	public static void main(String[] args) {
	  Scanner sc=new Scanner(System.in);
	  while(sc.hasNext())
	  {
	     int x=sc.nextInt();
	     if(x>=10000 &&x<=20000)
	     {
	        String str2 = Integer.toBinaryString(x); 
	        String str3 = Integer.toHexString(x); 
	        String str4 = Integer.toOctalString(x); 
	        System.out.print(str2+",");
	        System.out.print(str4+",");
	        System.out.println(str3);
	     }
	     else
	     {
	    	 float sum=0;
	    	 String s=Integer.toString(x);
	    	 for(int i=0;i<s.length();i++)
	    	 {
	    		 if(s.charAt(i)!='-')
	    		 {
	    			 System.out.print(s.charAt(i)+" ");
	    			 sum+=s.charAt(i)-48;
	    		 }
	    	 }
	    	 System.out.print((int)sum+"\n");
	    	 
	     }
	}
	}
}

